package com.avic.map.dal.mapper;

import com.avic.map.dal.condition.PageQueryMapSoldierCondition;
import com.avic.map.dal.condition.PageQuerySingleSoldierCondition;
import com.avic.map.dal.model.SingleSoldierResource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: huangsheng
 * @date: 2018/9/3
 */
@Mapper
public interface SingleSoldierResourceMapper {

    /**
     * 分页查询列表
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:20
     */
    List<SingleSoldierResource> itemList(PageQuerySingleSoldierCondition pageQuerySingleSoldierCondition);

    /**
     * 数据总数
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:20
     */
    int queryRecordsTotal(PageQuerySingleSoldierCondition pageQuerySingleSoldierCondition);


    /**
     * 新增单兵资源
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:21
     */
    int insert(SingleSoldierResource singleSoldier);

    /**
     * 根据ID查询单兵信息
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:21
     */
    SingleSoldierResource queryItemById(int id);

    /**
     * 根据单兵编号查询单兵信息数量
     *
     * @param personnelNumber 单兵编号
     * @return 数据数量
     */
    int queryItemCountByPersonnelNumber(String personnelNumber);

    /**
     * 修改单兵资源
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:23
     */
    int update(SingleSoldierResource singleSoldier);

    /**
     * 删除单兵资源
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:24
     */
    int delete(int id);

    /**
     * 获取所有单兵数据
     *
     * @return
     */
    List<SingleSoldierResource> queryAllSoldier();

    int updateSoldierState(@Param("soldierNumber") String soldierNumber, @Param("soldierState") int soldierState);

    SingleSoldierResource queryItemByPersonnelNumber(String personnelNumber);

    List<SingleSoldierResource> mapSoldierRecords(PageQueryMapSoldierCondition pageQueryMapSoldierCondition);

    int mapSoldierRecordsTotal(PageQueryMapSoldierCondition pageQueryMapSoldierCondition);

    List<SingleSoldierResource> querySoldierTreeRecords(int equipmentType);
}
